<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      Mesa-19.3.4
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-9.1">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 9.1
      </h4>
      <h3>
        Chapter&nbsp;24.&nbsp;X Window System Environment
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="xcb-util-cursor.html" title=
          "xcb-util-cursor-0.1.3">Prev</a>
          <p>
            xcb-util-cursor-0.1.3
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="xbitmaps.html" title=
          "xbitmaps-1.1.2">Next</a>
          <p>
            xbitmaps-1.1.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="installing.html" title=
          "Chapter&nbsp;24.&nbsp;X Window System Environment">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="mesa" name="mesa"></a>Mesa-19.3.4
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to Mesa
        </h2>
        <p>
          <span class="application">Mesa</span> is an OpenGL compatible 3D
          graphics library.
        </p>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            <span class="application">Mesa</span> is updated relatively
            often. You may want to use the latest available 19.3.x mesa
            version.
          </p>
        </div>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://mesa.freedesktop.org/archive/mesa-19.3.4.tar.xz">https://mesa.freedesktop.org/archive/mesa-19.3.4.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download (FTP): <a class="ulink" href=
                "ftp://ftp.freedesktop.org/pub/mesa/mesa-19.3.4.tar.xz">ftp://ftp.freedesktop.org/pub/mesa/mesa-19.3.4.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 09e7700d9af511384d131fb77b5802cb
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 11 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 398 MB (with demos and docs),
                add 204 MB for tests
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 2.4 SBU (with parallelism=4, demos, and
                docs), add 0.3 SBU for tests
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Additional Downloads
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Required patch: <a class="ulink" href=
                "http://www.linuxfromscratch.org/patches/blfs/9.1/mesa-19.3.4-fix_svga_vmwgfx_segfaults-1.patch">
                http://www.linuxfromscratch.org/patches/blfs/9.1/mesa-19.3.4-fix_svga_vmwgfx_segfaults-1.patch</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Recommended patch: <a class="ulink" href=
                "http://www.linuxfromscratch.org/patches/blfs/9.1/mesa-19.3.4-add_xdemos-1.patch">
                http://www.linuxfromscratch.org/patches/blfs/9.1/mesa-19.3.4-add_xdemos-1.patch</a>
                (installs 2 demo programs for testing Mesa - not needed if
                you install the <a class="ulink" href=
                "ftp://ftp.freedesktop.org/pub/mesa/demos/">mesa-demos</a>
                package)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Mesa Dependencies
        </h3>
        <h4>
          Required
        </h4>
        <p class="required">
          <a class="xref" href="x7lib.html" title="Xorg Libraries">Xorg
          Libraries</a>, <a class="xref" href="libdrm.html" title=
          "libdrm-2.4.100">libdrm-2.4.100</a>, and <a class="xref" href=
          "../general/python-modules.html#Mako" title=
          "Mako-1.1.1">Mako-1.1.1</a>
        </p>
        <h4>
          Recommended
        </h4>
        <p class="recommended">
          <a class="xref" href="x7driver.html#libva" title=
          "libva-2.6.1">libva-2.6.1</a> (to provide VA-API support for some
          gallium drivers, note that there is a circular dependency. You must
          build <span class="application">libva</span> first without EGL and
          GLX support, install this package, and rebuild <span class=
          "application">libva</span>), <a class="xref" href=
          "x7driver.html#libvdpau" title="libvdpau-1.3">libvdpau-1.3</a> (to
          build VDPAU drivers), <a class="xref" href="../general/llvm.html"
          title="LLVM-9.0.1">LLVM-9.0.1</a> (required for Gallium3D, nouveau,
          r300, and radeonsi drivers and for swrast, the software rasterizer
          which is sometimes referred to as llvmpipe. See <a class="ulink"
          href=
          "http://www.mesa3d.org/systems.html">http://www.mesa3d.org/systems.html</a>
          for more information), and <a class="xref" href=
          "../general/wayland-protocols.html" title=
          "Wayland-Protocols-1.18">wayland-protocols-1.18</a> (required for
          <a class="xref" href="../kde/plasma-all.html" title=
          "Building Plasma 5">Plasma-5.18.1</a>, GNOME, and recommended for
          <a class="xref" href="gtk3.html" title=
          "GTK+-3.24.13">GTK+-3.24.13</a>)
        </p>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="../general/libgcrypt.html" title=
          "libgcrypt-1.8.5">libgcrypt-1.8.5</a>, <a class="xref" href=
          "../general/lm_sensors.html" title=
          "lm-sensors-3-6-0">lm-sensors-3-6-0</a> , <a class="xref" href=
          "../postlfs/nettle.html" title="Nettle-3.5.1">Nettle-3.5.1</a>,
          <a class="xref" href="../general/valgrind.html" title=
          "Valgrind-3.15.0">Valgrind-3.15.0</a>, <a class="ulink" href=
          "ftp://ftp.freedesktop.org/pub/mesa/demos/">mesa-demos</a>
          (provides more than 300 extra demos to test <span class=
          "application">Mesa</span>; this includes the same programs added by
          the patch above), <a class="ulink" href=
          "http://omxil.sourceforge.net/">Bellagio OpenMAX Integration
          Layer</a> (for mobile platforms), <a class="ulink" href=
          "http://www.nongnu.org/libunwind/">libunwind</a>, and <a class=
          "ulink" href=
          "https://github.com/tizonia/tizonia-openmax-il/wiki/Tizonia-OpenMAX-IL/">
          libtizonia</a>
        </p>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            The instructions below assume that <span class=
            "application">LLVM</span> with the r600/amdgpu and host backends
            and run-time type information (RTTI - needed for nouveau) are
            installed. You will need to modify the instructions if you choose
            not to install all of these. For an explanation of Gallium3D see
            <a class="ulink" href=
            "https://en.wikipedia.org/wiki/Gallium3D">https://en.wikipedia.org/wiki/Gallium3D</a>.
          </p>
        </div>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/mesa">http://wiki.linuxfromscratch.org/blfs/wiki/mesa</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of Mesa
        </h2>
        <p>
          First, fix a problem when using Xorg with any device that uses the
          SVGA driver:
        </p>
        <pre class="userinput">
<kbd class=
"command">patch -Np1 -i ../mesa-19.3.4-fix_svga_vmwgfx_segfaults-1.patch</kbd>
</pre>
        <p>
          If you have downloaded the xdemos patch (needed if testing the Xorg
          installation per BLFS instructions), apply it by running the
          following command:
        </p>
        <pre class="userinput">
<kbd class="command">patch -Np1 -i ../mesa-19.3.4-add_xdemos-1.patch</kbd>
</pre>
        <p>
          If <a class="xref" href="../general/python2.html" title=
          "Python-2.7.17">Python-2.7.17</a> is not installed, adjust a script
          file in test suite to use Python 3:
        </p>
        <pre class="userinput">
<kbd class="command">sed '1s/python/&amp;3/' -i bin/symbols-check.py</kbd>
</pre>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            The measurements above, and the Contents below, are for a full
            build. Many people will not wish to install drivers they cannot
            use, so the following paragraphs explain how to limit the
            drivers, and give an example which can be be reduced or amended
            as necessary.
          </p>
        </div>
        <p>
          Now, select the drivers you wish to install. For the X86
          architecture, the available gallium drivers are auto, <span class=
          "emphasis"><em>or alternatively a choice from</em></span> i915,
          nouveau, r300, r600, radeonsi, svga, swrast, and virgl. The latter
          is recommended if you intend to run the system under <a class=
          "xref" href="../postlfs/qemu.html" title=
          "qemu-4.2.0">qemu-4.2.0</a>. If you wish to build all available
          gallium drivers, use 'auto'.
        </p>
        <p>
          The (non-gallium) DRI drivers available in X86 are auto,
          <span class="emphasis"><em>or alternatively a choice
          from</em></span> i915, i965, nouveau, r100, r200, and swrast. Use
          'auto' to build all available DRI drivers, or use an empty string
          (DRI_DRIVERS="") if you wish to only build gallium drivers.
        </p>
        <p>
          The platforms ("window systems") available for X86 linux are x11,
          wayland, drm, and surfaceless. By not specifying anything, the
          meson build-system will build for all these platforms if you have
          the dependencies, identical to if you had specified
          '-Dplatforms=auto'.
        </p>
        <p>
          Modify the commands below for your desired drivers. The drivers
          listed below will cover most modern video cards and virtual
          machines. For help in selecting drivers see <a class="ulink" href=
          "http://www.mesa3d.org/systems.html">http://www.mesa3d.org/systems.html</a>.
        </p>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            Although the nouveau drivers can be built for both gallium and
            dri, the i915 driver can only be built for one or the other.
          </p>
        </div>
        <pre class="userinput">
<kbd class=
"command">GALLIUM_DRV="i915,nouveau,r600,radeonsi,svga,swrast,virgl"
DRI_DRIVERS="i965,nouveau"</kbd>
</pre>
        <p>
          Install <span class="application">Mesa</span> by running the
          following commands:
        </p>
        <pre class="userinput">
<kbd class="command">mkdir build &amp;&amp;
cd    build &amp;&amp;

meson --prefix=$XORG_PREFIX          \
      -Dbuildtype=release            \
      -Ddri-drivers=$DRI_DRIVERS     \
      -Dgallium-drivers=$GALLIUM_DRV \
      -Dgallium-nine=false           \
      -Dglx=dri                      \
      -Dosmesa=gallium               \
      -Dvalgrind=false               \
      ..                             &amp;&amp;

unset GALLIUM_DRV DRI_DRIVERS &amp;&amp;

ninja</kbd>
</pre>
        <p>
          If you built the tests (see 'Command Explanations'), to run them
          issue: <span class="command"><strong>ninja test</strong></span>.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">ninja install</kbd>
</pre>
        <p>
          If desired, install the optional documentation by running the
          following commands as the <code class="systemitem">root</code>
          user:
        </p>
        <pre class="root">
<kbd class="command">install -v -dm755 /usr/share/doc/mesa-19.3.4 &amp;&amp;
cp -rfv ../docs/* /usr/share/doc/mesa-19.3.4</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <em class="parameter"><code>-Dbuildtype=release</code></em>: This
          switch ensures a fully-optimized build, and disables debug
          assertions which will severely slow down the libraries in certain
          use-cases. Without this switch, build sizes can span into the 2GB
          range.
        </p>
        <p>
          <em class="parameter"><code>-Ddri-drivers="..."</code></em>: This
          parameter controls which (non-gallium) dri drivers should be built.
        </p>
        <p>
          <em class="parameter"><code>-Dgallium-drivers="..."</code></em>:
          This parameter controls which Gallium3D drivers should be built.
        </p>
        <p>
          <code class="option">-Dgallium-nine=true</code>: Setting this
          option to true will provide support for (MS Windows) games designed
          for DX9.
        </p>
        <p>
          <em class="parameter"><code>-Dosmesa=gallium</code></em>: This
          switch enables building the <code class="filename">libOSMesa</code>
          library and provides Gallium3D support in it. It requires the
          swrast gallium driver.
        </p>
        <p>
          <em class="parameter"><code>-Dvalgrind=false</code></em>: This
          parameter disables the usage of Valgrind during the build process.
          Remove this parameter if you have Valgrind installed, and wish to
          check for memory leaks.
        </p>
        <p>
          <code class="option">-Dbuild-tests=true</code>: This option will
          cause the test code to be enabled.
        </p>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">glxgears and glxinfo</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">d3dadapter9.so, i915_dri.so, i965_dri.so,
              kms_swrast_dri.so, nouveau_dri.so, nouveau_drv_video.so,
              nouveau_vieux_dri.so, r200_dri.so, r300_dri.so, r600_dri.so,
              r600_drv_video.so, radeon_dri.so, radeonsi_dri.so,
              radeonsi_drv_video.so, swrast_dri.so, virtio_gpu_dri.so,
              vmwgfx_dri.so libEGL.so, libGL.so, libGLESv1_CM.so,
              libGLESv2.so, libOSMesa.so, libXvMCnouveau.so, libXvMCr600.so,
              libgbm.so, libglapi.so, libvulkan_intel.so,
              libvulkan_radeon.so, libxatracker.so, libvdpau_nouveau.so,
              libvdpau_r300.so, libvdpau_r600.so, and
              libvdpau_radeonsi.so</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class=
              "segbody">$XORG_PREFIX/{include/{d3dapater,EGL,GL,GLES,GLES2,GLES3,KHR,vulkan},lib/{d3d,dri,vdpau}}
              $XORG_PREFIX/share/drirc.d (contains workarounds for various
              applications, particularly browsers and games)
              $XORG_PREFIX/share/vulkan/icd.d, and /usr/share/doc/mesa-19.3.4
              (optional)</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="glxgears" name="glxgears"></a><span class=
                    "term"><span class=
                    "command"><strong>glxgears</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a GL demo useful for troubleshooting graphics
                    problems.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="glxinfo" name="glxinfo"></a><span class=
                    "term"><span class=
                    "command"><strong>glxinfo</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a diagnostic program that displays information about
                    the graphics hardware and installed GL libraries.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libEGL" name="libEGL"></a><span class=
                    "term"><code class="filename">libEGL.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    provides a native platform graphics interface as defined
                    by the EGL-1.4 specification.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libgbm" name="libgbm"></a><span class=
                    "term"><code class="filename">libgbm.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the <span class="application">Mesa</span> Graphics
                    Buffer Manager library.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libGLESv1_CM" name="libGLESv1_CM"></a><span class=
                    "term"><code class=
                    "filename">libGLESv1_CM.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the <span class="application">Mesa</span> OpenGL ES
                    1.1 library.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libGLES2" name="libGLES2"></a><span class=
                    "term"><code class="filename">libGLES2.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the <span class="application">Mesa</span> OpenGL ES
                    2.0 library.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libGL" name="libGL"></a><span class=
                    "term"><code class="filename">libGL.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the main <span class="application">Mesa</span> OpenGL
                    library.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libOSMesa" name="libOSMesa"></a><span class=
                    "term"><code class="filename">libOSMesa.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the <span class="application">Mesa</span> Off-screen
                    Rendering library.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-02-18 11:26:31 -0800
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="xcb-util-cursor.html" title=
          "xcb-util-cursor-0.1.3">Prev</a>
          <p>
            xcb-util-cursor-0.1.3
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="xbitmaps.html" title=
          "xbitmaps-1.1.2">Next</a>
          <p>
            xbitmaps-1.1.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="installing.html" title=
          "Chapter&nbsp;24.&nbsp;X Window System Environment">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
